import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
       {
           path: '/login',
           component: () => import("../views/Login.vue"),
           meta: { title: '登录'}
       },
       {
           path: '/',
           redirect: '/dashboard'
       },
       {
           path: '/',
           component: () => import("../views/Home.vue"),
           meta: { title: '自述文件'},
           children: [
               {
                   path:'/dashboard',
                   component: () => import("../views/Dashboard.vue"),
                   meta: { title: '系统首页' }
               },
               {
                    path: '/table',
                    component: () => import("../views/Table.vue"),
                    meta: { title: '基础表格'}
               },
                {
                    path: '/tabs',
                    component: () => import("../views/Tabs.vue"),
                    meta: { title: 'tab选项卡'}
               },
               {
                path: '/form',
                component: () => import("../views/Form"),
                meta: { title: '基本表单'}
                },
                {
                path: '/editor',
                component: () => import("../views/Editor"),
                meta: { title: '富文本编辑器'}
                },
                {
                path: '/markdown',
                component: () => import("../views/Markdown"),
                meta: { title: 'markdown编辑器'}
                },
                {
                path: '/upload',
                component: () => import("../views/Upload"),
                meta: { title: '文件上传'}
                },
                {
                path: '/icon',
                component: () => import("../views/Icon"),
                meta: { title: '自定义图标'}
                },
                {
                path: '/charts',
                component: () => import("../views/Charts"),
                meta: { title: 'charts图表'}
                },
                {
                path: '/drag',
                component: () => import("../views/Drag"),
                meta: { title: '拖拽列表'}
                },
                {
                path: '/dialog',
                component: () => import("../views/Dialog"),
                meta: { title: '拖拽弹框'}
                },
                {
                path: '/i18n',
                component: () => import("../views/I18n"),
                meta: { title: '国际化'}
                },
                {
                path: '/permission',
                component: () => import("../views/Permission"),
                meta: { title: '权限测试', permission: true}
                },
                {
                path: '/403',
                component: () => import("../views/403"),
                meta: { title: '403'}
                },
                {
                path: '/404',
                component: () => import("../views/404"),
                meta: { title: '404'}
                },
                {
                path: '/donate',
                component: () => import("../views/Donate"),
                meta: { title: '支持作者'}
                },
           ]
       },
       {
           path: '*',
           redirect: '/404'
       }
    ]
});
